Micron Document
<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Luhn algorithm</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Luhn_algorithm"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/ext.math.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Luhn_algorithm rootpage-Luhn_algorithm skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Luhn algorithm</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr">
<style data-mw-deduplicate="TemplateStyles:r1236090951">
/* start https://en.wikipedia.org/ */


.mw-parser-output .hatnote{font-style:italic}.mw-parser-output div.hatnote{padding-left:1.6em;margin-bottom:0.5em}.mw-parser-output .hatnote i{font-style:normal}.mw-parser-output .hatnote+link+.hatnote{margin-top:-0.5em}@media print{body.ns-0 .mw-parser-output .hatnote{display:none!important}}


/* end https://en.wikipedia.org/ */
</style><div role="note" class="hatnote navigation-not-searchable">"Luhn" redirects here. For people named Luhn, see <a href="Luhn_(surname)" title="Luhn (surname)">Luhn (surname)</a>.</div>
<p>The <b>Luhn algorithm</b> or <b>Luhn formula</b> (creator: <a href="IBM" title="IBM">IBM</a> scientist <a href="Hans_Peter_Luhn" title="Hans Peter Luhn">Hans Peter Luhn</a>), also known as the "<a href="Modular_arithmetic" title="Modular arithmetic">modulus</a> 10" or "mod 10" <a href="Algorithm" title="Algorithm">algorithm</a>, is a simple <a href="Check_digit" title="Check digit">check digit</a> formula used to validate a variety of identification numbers. <sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>a<span class="cite-bracket">]</span></a></sup>
</p><p>The algorithm is in the <a href="Public_domain" title="Public domain">public domain</a> and is in wide use today. It is specified in <a href="ISO/IEC_7812-1" class="mw-redirect" title="ISO/IEC 7812-1">ISO/IEC 7812-1</a>.<sup id="cite_ref-3" class="reference"><a href="#cite_note-3"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> It is not intended to be a <a href="Cryptographic_hash_function" title="Cryptographic hash function">cryptographically secure hash function</a>; it was designed to protect against accidental errors, not malicious attacks. Most <a href="Credit_card_number" class="mw-redirect" title="Credit card number">credit card numbers</a> and many <a href="Government_identification_numbers" class="mw-redirect" title="Government identification numbers">government identification numbers</a> use the algorithm as a simple method of distinguishing valid numbers from mistyped or otherwise incorrect numbers.
</p>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="Description">Description</h2></div>
<p>The check digit is computed as follows:
</p>
<ol><li>Drop the check digit from the number (if it's already present). This leaves the payload.</li>
<li>Start with the payload digits. Moving from right to left, double every second digit, starting from the last digit. If doubling a digit results in a value &gt; 9, subtract 9 from it (or sum its digits).</li>
<li>Sum all the resulting digits (including the ones that were not doubled).</li>
<li>The check digit is calculated by <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle (10-(s{\bmod {1}}0)){\bmod {1}}0}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mo stretchy="false">(</mo>
<mn>10</mn>
<mo>−<!-- − --></mo>
<mo stretchy="false">(</mo>
<mi>s</mi>
<mrow class="MJX-TeXAtom-ORD">
<mo lspace="thickmathspace" rspace="thickmathspace">mod</mo>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
</mrow>
</mrow>
<mn>0</mn>
<mo stretchy="false">)</mo>
<mo stretchy="false">)</mo>
<mrow class="MJX-TeXAtom-ORD">
<mo lspace="thickmathspace" rspace="thickmathspace">mod</mo>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
</mrow>
</mrow>
<mn>0</mn>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle (10-(s{\bmod {1}}0)){\bmod {1}}0}</annotation>
</semantics>
</math></span><img src="./9178b597d6168b66cfa8c99aeb1a32cd2467327e.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:25.887ex; height:2.843ex;" alt="{\displaystyle (10-(s{\bmod {1}}0)){\bmod {1}}0}" loading="lazy"></span>, where s is the sum from step 3. This is the smallest number (possibly zero) that must be added to <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle s}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>s</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle s}</annotation>
</semantics>
</math></span><img src="./01d131dfd7673938b947072a13a9744fe997e632.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.09ex; height:1.676ex;" alt="{\displaystyle s}" loading="lazy"></span> to make a multiple of 10. Other valid formulas giving the same value are <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 9-((s+9){\bmod {1}}0)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mn>9</mn>
<mo>−<!-- − --></mo>
<mo stretchy="false">(</mo>
<mo stretchy="false">(</mo>
<mi>s</mi>
<mo>+</mo>
<mn>9</mn>
<mo stretchy="false">)</mo>
<mrow class="MJX-TeXAtom-ORD">
<mo lspace="thickmathspace" rspace="thickmathspace">mod</mo>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
</mrow>
</mrow>
<mn>0</mn>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 9-((s+9){\bmod {1}}0)}</annotation>
</semantics>
</math></span><img src="./87a7817f16fac5c24dbf45d6319ddf3cc48b744a.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:20.721ex; height:2.843ex;" alt="{\displaystyle 9-((s+9){\bmod {1}}0)}" loading="lazy"></span>, <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle (10-s){\bmod {1}}0}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mo stretchy="false">(</mo>
<mn>10</mn>
<mo>−<!-- − --></mo>
<mi>s</mi>
<mo stretchy="false">)</mo>
<mrow class="MJX-TeXAtom-ORD">
<mo lspace="thickmathspace" rspace="thickmathspace">mod</mo>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
</mrow>
</mrow>
<mn>0</mn>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle (10-s){\bmod {1}}0}</annotation>
</semantics>
</math></span><img src="./91929ceecbe622b2298a8254f7220e28ccf43166.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:16.071ex; height:2.843ex;" alt="{\displaystyle (10-s){\bmod {1}}0}" loading="lazy"></span>, and <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 10\lceil s/10\rceil -s}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mn>10</mn>
<mo fence="false" stretchy="false">⌈<!-- ⌈ --></mo>
<mi>s</mi>
<mrow class="MJX-TeXAtom-ORD">
<mo>/</mo>
</mrow>
<mn>10</mn>
<mo fence="false" stretchy="false">⌉<!-- ⌉ --></mo>
<mo>−<!-- − --></mo>
<mi>s</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 10\lceil s/10\rceil -s}</annotation>
</semantics>
</math></span><img src="./3da5e6ac2ce15ed3c950766dd53d5206ee747201.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:12.898ex; height:2.843ex;" alt="{\displaystyle 10\lceil s/10\rceil -s}" loading="lazy"></span>. Note that the formula <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle (10-s){\bmod {1}}0}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mo stretchy="false">(</mo>
<mn>10</mn>
<mo>−<!-- − --></mo>
<mi>s</mi>
<mo stretchy="false">)</mo>
<mrow class="MJX-TeXAtom-ORD">
<mo lspace="thickmathspace" rspace="thickmathspace">mod</mo>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
</mrow>
</mrow>
<mn>0</mn>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle (10-s){\bmod {1}}0}</annotation>
</semantics>
</math></span><img src="./91929ceecbe622b2298a8254f7220e28ccf43166.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:16.071ex; height:2.843ex;" alt="{\displaystyle (10-s){\bmod {1}}0}" loading="lazy"></span> will not work in all environments due to differences in how negative numbers are handled by the <a href="Modulo" title="Modulo">modulo</a> operation.</li></ol>
<div class="mw-heading mw-heading3"><h3 id="Example_for_computing_check_digit">Example for computing check digit</h3></div>
<p>Assume an example of an account number 1789372997 (just the "payload", check digit not yet included):
</p>
<table class="wikitable" style="text-align:center;border:none;">
<tbody><tr>
<th style="width:1.5em">Digits reversed
</th>
<td style="width:1.5em">7
</td>
<td style="width:1.5em">9
</td>
<td style="width:1.5em">9
</td>
<td style="width:1.5em">2
</td>
<td style="width:1.5em">7
</td>
<td style="width:1.5em">3
</td>
<td style="width:1.5em">9
</td>
<td style="width:1.5em">8
</td>
<td style="width:1.5em">7
</td>
<td style="width:1.5em">1
</td></tr>
<tr>
<th>Multipliers
</th>
<td>2
</td>
<td>1
</td>
<td>2
</td>
<td>1
</td>
<td>2
</td>
<td>1
</td>
<td>2
</td>
<td>1
</td>
<td>2
</td>
<td>1
</td></tr>
<tr>
<th>
</th>
<td>=
</td>
<td>=
</td>
<td>=
</td>
<td>=
</td>
<td>=
</td>
<td>=
</td>
<td>=
</td>
<td>=
</td>
<td>=
</td>
<td>=
</td></tr>
<tr>
<th>
</th>
<td style="background: #FFA; color: #000;"><b>14</b>
</td>
<td>9
</td>
<td style="background: #FFA; color: #000;"><b>18</b>
</td>
<td>2
</td>
<td style="background: #FFA; color: #000;"><b>14</b>
</td>
<td>3
</td>
<td style="background: #FFA; color: #000;"><b>18</b>
</td>
<td>8
</td>
<td style="background: #FFA; color: #000;"><b>14</b>
</td>
<td>1
</td></tr>
<tr>
<th>Sum digits
</th>
<td><b>5</b> <br> (1+4)
</td>
<td>9 <br> &nbsp;
</td>
<td><b>9</b> <br> (1+8)
</td>
<td>2 <br> &nbsp;
</td>
<td><b>5</b> <br> (1+4)
</td>
<td>3 <br> &nbsp;
</td>
<td><b>9</b> <br> (1+8)
</td>
<td>8 <br> &nbsp;
</td>
<td><b>5</b> <br> (1+4)
</td>
<td>1 <br> &nbsp;
</td></tr></tbody></table>
<p>The sum of the resulting digits is 56.
</p><p>The check digit is equal to <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle (10-(56{\bmod {1}}0)){\bmod {1}}0=4}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mo stretchy="false">(</mo>
<mn>10</mn>
<mo>−<!-- − --></mo>
<mo stretchy="false">(</mo>
<mn>56</mn>
<mrow class="MJX-TeXAtom-ORD">
<mo lspace="thickmathspace" rspace="thickmathspace">mod</mo>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
</mrow>
</mrow>
<mn>0</mn>
<mo stretchy="false">)</mo>
<mo stretchy="false">)</mo>
<mrow class="MJX-TeXAtom-ORD">
<mo lspace="thickmathspace" rspace="thickmathspace">mod</mo>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
</mrow>
</mrow>
<mn>0</mn>
<mo>=</mo>
<mn>4</mn>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle (10-(56{\bmod {1}}0)){\bmod {1}}0=4}</annotation>
</semantics>
</math></span><img src="./c2248038fae5b1760bab30abcf223dfdc37458f3.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:31.382ex; height:2.843ex;" alt="{\displaystyle (10-(56{\bmod {1}}0)){\bmod {1}}0=4}" loading="lazy"></span>.
</p><p>This makes the full account number read 17893729974.
</p>
<div class="mw-heading mw-heading3"><h3 id="Example_for_validating_check_digit">Example for validating check digit</h3></div>
<ol><li>Drop the check digit (last digit) of the number to validate. (e.g. 17893729974 → 1789372997)</li>
<li>Calculate the check digit (see above)</li>
<li>Compare your result with the original check digit. If both numbers match, the result is valid. <span class="nowrap">(e.g. (givenCheckDigit = calculatedCheckDigit) ⇔ (isValidCheckDigit)).</span></li></ol>
<div class="mw-heading mw-heading2"><h2 id="Strengths_and_weaknesses">Strengths and weaknesses</h2></div>
<p>The Luhn algorithm will detect all single-digit errors, as well as almost all transpositions of adjacent digits. It will not, however, detect transposition of the two-digit sequence <i>09</i> to <i>90</i> (or vice versa). It will detect most of the possible twin errors (it will not detect <i>22</i> ↔ <i>55</i>, <i>33</i> ↔ <i>66</i> or <i>44</i> ↔ <i>77</i>).
</p><p>Other, more complex check-digit algorithms (such as the <a href="Verhoeff_algorithm" title="Verhoeff algorithm">Verhoeff algorithm</a> and the <a href="Damm_algorithm" title="Damm algorithm">Damm algorithm</a>) can detect more transcription errors. The <a href="Luhn_mod_N_algorithm" title="Luhn mod N algorithm">Luhn mod N algorithm</a> is an extension that supports non-numerical strings.
</p><p>Because the algorithm operates on the digits in a right-to-left manner and zero digits affect the result only if they cause shift in position, zero-padding the beginning of a string of numbers does not affect the calculation. Therefore, systems that pad to a specific number of digits (by converting 1234 to 0001234 for instance) can perform Luhn validation before or after the padding and achieve the same result.
</p><p>The algorithm appeared in a United States Patent<sup id="cite_ref-US2950048A_1-1" class="reference"><a href="#cite_note-US2950048A-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> for a simple, hand-held, mechanical device for computing the checksum. The device took the mod 10 sum by mechanical means. The <i>substitution digits</i>, that is, the results of the double and reduce procedure, were not produced mechanically. Rather, the digits were marked in their permuted order on the body of the machine.
</p>
<div class="mw-heading mw-heading2"><h2 id="Pseudocode_implementation">Pseudocode implementation</h2></div>
<p>The following function takes a card number, including the check digit, as an array of integers and outputs <b>true</b> if the check digit is correct, <b>false</b> otherwise.
</p>
<pre><b>function</b> isValid(cardNumber[1..length])
sum&nbsp;:= 0
parity&nbsp;:= length mod 2
<b>for</b> i from 1 to (length - 1) <b>do</b>
<b>if</b> i mod 2 == parity <b>then</b>
sum&nbsp;:= sum + cardNumber[i]
<b>elseif</b> cardNumber[i] &gt; 4 <b>then</b>
sum&nbsp;:= sum + 2 * cardNumber[i] - 9
<b>else</b>
sum&nbsp;:= sum + 2 * cardNumber[i]
<b>end if</b>
<b>end for</b>
<b>return</b> cardNumber[length] == ((10 - (sum mod 10)) mod 10)
<b>end function</b>
</pre>
<div class="mw-heading mw-heading2"><h2 id="Uses">Uses</h2></div>
<p>The Luhn algorithm is used in a variety of systems, including:
</p>
<ul><li><a href="Payment_card_number" title="Payment card number">Credit card numbers</a></li>
<li><a href="International_Mobile_Equipment_Identity" title="International Mobile Equipment Identity">IMEI numbers</a></li>
<li><a href="CUSIP" title="CUSIP">CUSIP</a> numbers for North American financial instruments</li>
<li><a href="National_Provider_Identifier" title="National Provider Identifier">National Provider Identifier numbers</a> in the United States</li>
<li><a href="Canada" title="Canada">Canadian</a> <a href="Social_insurance_number" title="Social insurance number">social insurance numbers</a></li>
<li><a href="Israeli_identity_card" title="Israeli identity card">Israeli</a> ID numbers</li>
<li><a href="South_Africa" title="South Africa">South African</a> ID numbers</li>
<li><a href="South_Africa" title="South Africa">South African</a> Tax reference numbers</li>
<li><a href="Personal_identity_number_(Sweden)" title="Personal identity number (Sweden)"> Swedish Personal identity numbers </a></li>
<li><a href="Sweden" title="Sweden">Swedish</a> Corporate Identity Numbers (OrgNr)</li>
<li><a href="Greece" title="Greece">Greek</a> Social Security Numbers (ΑΜΚΑ)</li>
<li><a href="SIM_card#ICCID" title="SIM card">ICCID</a> of SIM cards</li>
<li><a href="European_Patent_Convention" title="European Patent Convention">European patent</a> application numbers</li>
<li>Survey codes appearing on McDonald's, Taco Bell, and Tractor Supply Co. receipts</li>
<li><a href="United_States_Postal_Service" title="United States Postal Service">United States Postal Service</a> package tracking numbers use a modified Luhn algorithm<sup id="cite_ref-4" class="reference"><a href="#cite_note-4"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup></li>
<li>Italian VAT numbers (<a href="VAT_identification_number#European_Union_VAT_identification_numbers" title="VAT identification number">Partita Iva</a>)<sup id="cite_ref-5" class="reference"><a href="#cite_note-5"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup></li></ul>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-US2950048A-1"><span class="mw-cite-backlink">^ <a href="#cite_ref-US2950048A_1-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-US2950048A_1-1"><sup><i><b>b</b></i></sup></a></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1041539562">
/* start https://en.wikipedia.org/ */


.mw-parser-output .citation{word-wrap:break-word}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}


/* end https://en.wikipedia.org/ */
</style><span class="citation patent" id="CITEREFLuhn1960"><a rel="nofollow" class="external text" href="https://worldwide.espacenet.com/textdoc?DB=EPODOC&amp;IDX=US2950048A">US patent 2950048A</a>, <a href="Hans_Peter_Luhn" title="Hans Peter Luhn">Luhn, Hans Peter</a>, "Computer for Verifying Numbers", published 23 August 1960, issued 23 August 1960</span><span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Apatent&amp;rft.number=2950048A&amp;rft.cc=US&amp;rft.title=Computer+for+Verifying+Numbers&amp;rft.inventor=Luhn&amp;rft.date=23 August 1960&amp;rft.appldate=1954-01-06&amp;rft.pubdate=23 August 1960"><span style="display: none;">&nbsp;</span></span></span>
</li>
<li id="cite_note-3"><span class="mw-cite-backlink"><b><a href="#cite_ref-3">^</a></b></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */


.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}


/* end https://en.wikipedia.org/ */
</style><cite class="citation techreport cs1">"Annex B: Luhn formula for computing modulus-10 "double-add-double" check digits". <a rel="nofollow" class="external text" href="https://www.iso.org/standard/70484.html"><i>Identification cards — Identification of issuers — Part 1: Numbering system</i></a> (standard). <a href="International_Organization_for_Standardization" title="International Organization for Standardization">International Organization for Standardization</a> &amp; <a href="International_Electrotechnical_Commission" title="International Electrotechnical Commission">International Electrotechnical Commission</a>. January 2017. <a href="ISO/IEC_7812" title="ISO/IEC 7812">ISO/IEC 7812</a>-1:2017.</cite></span>
</li>
<li id="cite_note-4"><span class="mw-cite-backlink"><b><a href="#cite_ref-4">^</a></b></span> <span class="reference-text"><cite class="citation book cs1"><a rel="nofollow" class="external text" href="https://postalpro.usps.com/mnt/glusterfs/2023-10/Pub%20199_v28_10102023.pdf"><i>Publication 199: Intelligent Mail Package Barcode (IMpb) Implementation Guide for Confirmation Services and Electronic Payment Systems</i></a> <span class="cs1-format">(PDF)</span> (28th&nbsp;ed.). <a href="United_States" title="United States">United States</a>: <a href="United_States_Postal_Service" title="United States Postal Service">United States Postal Service</a>. 10 October 2023. <a rel="nofollow" class="external text" href="https://web.archive.org/web/20231117004502id_/https://postalpro.usps.com/mnt/glusterfs/2023-10/Pub%20199_v28_10102023.pdf">Archived</a> <span class="cs1-format">(PDF)</span> from the original on 17 November 2023<span class="reference-accessdate">. Retrieved <span class="nowrap">29 November</span> 2023</span>.</cite></span>
</li>
<li id="cite_note-5"><span class="mw-cite-backlink"><b><a href="#cite_ref-5">^</a></b></span> <span class="reference-text"><cite id="CITEREFAlbanese2022" class="citation web cs1 cs1-prop-foreign-lang-source">Albanese, Ilenia (10 August 2022). <a rel="nofollow" class="external text" href="https://www.partitaiva.it/partita-iva-cosa-serve/">"A cosa serve la Partita Iva? Ecco cosa sapere"</a> [What is a VAT number for? Here's what to know]. <i>Partitaiva.it</i> (in Italian). <a rel="nofollow" class="external text" href="https://web.archive.org/web/20240629162018/https://www.partitaiva.it/partita-iva-cosa-serve/">Archived</a> from the original on 29 June 2024<span class="reference-accessdate">. Retrieved <span class="nowrap">29 June</span> 2024</span>.</cite></span>
</li>
</ol></div>
<div class="mw-heading mw-heading2"><h2 id="Notes">Notes</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239543626">
/* start https://en.wikipedia.org/ */


.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}


/* end https://en.wikipedia.org/ */
</style><div class="reflist reflist-lower-alpha">
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-2">^</a></b></span> <span class="reference-text">It is described in <a href="United_States" title="United States">US</a> patent 2950048A, granted on 23 August 1960.<sup id="cite_ref-US2950048A_1-0" class="reference"><a href="#cite_note-US2950048A-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup></span>
</li>
</ol></div></div>
<div class="mw-heading mw-heading2"><h2 id="External_links">External links</h2></div>
<ul><li><a rel="nofollow" class="external text" href="https://rosettacode.org/wiki/Luhn_test_of_credit_card_numbers">Luhn test of credit card numbers</a> on <a href="Rosetta_Code" title="Rosetta Code">Rosetta Code</a>: Luhn algorithm/formula implementation in 160 programming languages as of 22&nbsp;July&nbsp;2024</li></ul></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2025-08-07" href="https://en.wikipedia.org/wiki/?title=Luhn_algorithm&amp;oldid=1304683677">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>

</body></html>